<?php

namespace App\Admin\Override\Field;

use Dcat\Admin\Form\Field\Text;

class Decimal extends Text
{
    protected $symbol = '<i class="fa fa-terminal fa-fw"></i>';
    /**
     * @see https://github.com/RobinHerbots/Inputmask#options
     *
     * @var array
     */
    protected $options = [
        'alias'      => 'decimal',
        'rightAlign' => false,
    ];

    /**
     * Set symbol for currency field.
     *
     * @param  string  $symbol
     * @return $this
     */
    public function symbol($symbol)
    {
        $this->symbol = $symbol;

        return $this;
    }

    public function render()
    {
        $this->inputmask($this->options);

        $this->prepend($this->symbol);

        return parent::render();
    }
}
